use alice2d::{App, math::{Vector2, Vector2u}};
use alice2d_input::editor::EditorLayer;

#[cfg(target_arch="wasm32")]
use wasm_bindgen::prelude::*;





fn main() {
    let game_loop = App::create_main_loop();
    let mut app     = App::new(&game_loop);
    let editor = Box::new(EditorLayer::new(app.ctx().clone()));
    app.push_layer(editor);
    
    // TODO 要根据 编辑器 viewport 的位置大小 重新设置 renderTarget 的输出纹理大小

    game_loop.run(move |event, _, control_flow| {

        let editor_layer = app.get_layer::<EditorLayer>("editor_layer");
        editor_layer.platform.handle_event(&event);
        
        app.run(event,control_flow);
    });
  
}








